import subprocess

# 多个命令，每个命令及其参数作为元组
commands = [
    'echo Hello',
    'dir'  # 移除额外的逗号
]

# 使用Popen执行多个命令
process = subprocess.Popen(commands, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

# 获取标准输出和标准错误输出
output, error = process.communicate()

# 打印输出结果
print("Output:", output.decode('gbk'))
print("Error:", error.decode('gbk'))

if __name__ == '__main__':
    pass
